package com.dto.cnc;

import com.bean.variables.AutoData_Variables;
import lombok.Data;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Data
public class CncDTO {

    /*PLC*/
    /*地址-值*/
    private static Map<String,String> cncPlcMap = new HashMap<>();

    /*设备静态信息*/
    /*编号*/
    private static String cncId = "";

    /*型号*/
    private static String cncSeriesModel = "";
//    private static String deviceSeriesModel = cncSeriesModel;


    /*设备名称*/
    private static String cncName = "";;
    private static String cnc_name = "";
//    private static String deviceName = cnc_name;

    /*厂家品牌*/
    private static String cncBrand = "";
//    private static String deviceTradeMark = cnc_trade_mark;


    //生产日期
    private static String cnc_produceDate;

    /*保修状态*/
    private static String cncWarranty;
    /*联系方式*/
    private static String cncCallCenter;

    /*授权码*/
    private static String cncAuthorizationCode;


    /*机床刀具数量*/
    private static String toolCount;
    /*当前机床刀具*/
    private static String tools;



    /*机床通知信息*/
    private static String message = "";

    /*机床状态*/
    private static String cnc_state;
    private static String cnc_ip;
    private static String cnc_port;







    /*机床轴信息*/
    private static Integer cnc_axis_number=0;//机床轴个数
    private static List<String> cnc_axis_name = new ArrayList<>();//机床所有轴信息
    private static List<String> cnc_axis_main = new ArrayList<>();//机床主轴信息
    private static List<String> cnc_axis_logic = new ArrayList<>();//机床逻辑轴信息
    private static List<String> cnc_axis_paName = new ArrayList<>();//逻辑轴绑定的物理轴名
    private static List<String> cnc_axis_spMode = new ArrayList<>();//逻辑轴是否工作在主轴模式

    private static List<AutoData_Variables> cnc_axis_variables_torque = new ArrayList<>();//逻辑轴是否工作在主轴模式

    /*换刀状态  G_B_T_CHANGING : BOOL ; (*正在换刀标志*)*/
    private static String G_B_T_CHANGING="";
    /*机床加工状态*/
    private static int cncWorkStateNum;
    private static String cncWorkState = "";
    /*机床加工模式*/
    private static int cncWorkModeNum;
    private static String cncWorkMode;
    /*机床当前NC程序名*/
    private static String cncNcFile = "null";
    /*当前程序段号*/
    private static String block = "null";
    /*系统启动时间*/
    private static int proctimestartNum = 0;
    private static String proctimestart = "0";

    /*程序运行时间*/
    private static int proctimeprocNum = 0;
    private static String proctimeproc = "0";

    /*剩余加工时间*/
    private static String remaindertime = "0";
    private static int remaindertimeNum = 0;

    /*主轴实际速度*/
    private static String mainAxisAct = "0";
    /*主轴坐标*/
    private static String mainAxisPosition = "0";
    /*主轴倍率*/
    private static String mainAxisOver = "0";
    /*主轴进给*/
    private static String mainAxisFeed = "0";


    /*机床SoftPlc参数*/
    private static String cnc_plc_ip;
    private static String cnc_plc_port;
    private static List<String> cnc_plc_vars = new ArrayList<>();//PLC变量
    private static List<String> cnc_nc_vars = new ArrayList<>();//宏参数变量


    /*机床采集变量*/
    private static String cnc_vars ="null";
    /*机床加工指令*/
    private static String cncStartCode = "0";
    /*急停*/
    private static String cncStopCode = "0";
    /*复位*/
    private static String cncResetCode = "0";
    /*监听指令*/
    private static String cncListenCode = "1"/*默认系统启动监听机床信息*/;
    /*坐标采集周期*/
    private static String cncAxesRate = "";



    /*--------------------------------------------------------------*/

    public static int getCncWorkStateNum() {
        return cncWorkStateNum;
    }

    public static void setCncWorkStateNum(int cncWorkStateNum) {
        CncDTO.cncWorkStateNum = cncWorkStateNum;
    }

    public static String getCncWorkState() {
        return cncWorkState;
    }

    public static void setCncWorkState(String cncWorkState) {
        CncDTO.cncWorkState = cncWorkState;
    }

    public static int getCncWorkModeNum() {
        return cncWorkModeNum;
    }

    public static void setCncWorkModeNum(int cncWorkModeNum) {
        CncDTO.cncWorkModeNum = cncWorkModeNum;
    }

    public static String getCncWorkMode() {
        return cncWorkMode;
    }

    public static void setCncWorkMode(String cncWorkMode) {
        CncDTO.cncWorkMode = cncWorkMode;
    }

    public static String getCncStopCode() {
        return cncStopCode;
    }

    public static void setCncStopCode(String cncStopCode) {
        CncDTO.cncStopCode = cncStopCode;
    }

    public static String getCncResetCode() {
        return cncResetCode;
    }

    public static void setCncResetCode(String cncResetCode) {
        CncDTO.cncResetCode = cncResetCode;
    }

    public static String getToolCount() {
        return toolCount;
    }

    public static void setToolCount(String toolCount) {
        CncDTO.toolCount = toolCount;
    }

    public static String getCncName() {
        return cncName;
    }

    public static void setCncName(String cncName) {
        CncDTO.cncName = cncName;
    }

    public static String getCnc_name() {
        return cnc_name;
    }

    public static void setCnc_name(String cnc_name) {
        CncDTO.cnc_name = cnc_name;
    }

    public static String getCncCallCenter() {
        return cncCallCenter;
    }

    public static void setCncCallCenter(String cncCallCenter) {
        CncDTO.cncCallCenter = cncCallCenter;
    }

    public static String getCncId() {
        return cncId;
    }

    public static void setCncId(String cncId) {
        CncDTO.cncId = cncId;
    }



    public static String getCncBrand() {
        return cncBrand;
    }

    public static void setCncBrand(String cncBrand) {
        CncDTO.cncBrand = cncBrand;
    }

    public static String getCncWarranty() {
        return cncWarranty;
    }

    public static void setCncWarranty(String cncWarranty) {
        CncDTO.cncWarranty = cncWarranty;
    }

    public static String getCncAuthorizationCode() {
        return cncAuthorizationCode;
    }

    public static void setCncAuthorizationCode(String cncAuthorizationCode) {
        CncDTO.cncAuthorizationCode = cncAuthorizationCode;
    }


    public static List<String> getCnc_nc_vars() {
        return cnc_nc_vars;
    }

    public static void setCnc_nc_vars(List<String> cnc_nc_vars) {
        CncDTO.cnc_nc_vars = cnc_nc_vars;
    }

    public static String getgBTChanging() {
        return G_B_T_CHANGING;
    }

    public static void setgBTChanging(String gBTChanging) {
        G_B_T_CHANGING = gBTChanging;
    }



    public static String getCnc_vars() {
        return cnc_vars;
    }

    public static void setCnc_vars(String cnc_vars) {
        CncDTO.cnc_vars = cnc_vars;
    }

    public static String getBlock() {
        return block;
    }

    public static void setBlock(String block) {
        CncDTO.block = block;
    }

    public static String getCncAxesRate() {
        return cncAxesRate;
    }

    public static void setCncAxesRate(String cncAxesRate) {
        CncDTO.cncAxesRate = cncAxesRate;
    }

    public static String getCncListenCode() {
        return cncListenCode;
    }

    public static void setCncListenCode(String cncListenCode) {
        CncDTO.cncListenCode = cncListenCode;
    }

    public static String getCncStartCode() {
        return cncStartCode;
    }

    public static void setCncStartCode(String cncStartCode) {
        CncDTO.cncStartCode = cncStartCode;

//        if (cncStartCode == "1"){
//            System.out.println(new CNCService(
//                    "<mode>",
//                    "<req>yes</req>",
//                    "",
//                    "<st>nc1</st>",
//                    "<sub>start</sub>",
//                    "",
//                    "",
//                    "",
//                    "","","",
//                    "</mode>"
//            ).readValue());
//            CncDTO.cncStartCode = "0";
//        }
    }

    public static List<String> getCnc_plc_vars() {
        return cnc_plc_vars;
    }

    public static void setCnc_plc_vars(List<String> cnc_plc_vars) {
        CncDTO.cnc_plc_vars = cnc_plc_vars;
    }

    public static String getCnc_plc_ip() {
        return cnc_plc_ip;
    }

    public static void setCnc_plc_ip(String cnc_plc_ip) {
        CncDTO.cnc_plc_ip = cnc_plc_ip;
    }

    public static String getCnc_plc_port() {
        return cnc_plc_port;
    }

    public static void setCnc_plc_port(String cnc_plc_port) {
        CncDTO.cnc_plc_port = cnc_plc_port;
    }



    public static List<AutoData_Variables> getCnc_axis_variables_torque() {
        return cnc_axis_variables_torque;
    }

    public static void setCnc_axis_variables_torque(List<AutoData_Variables> cnc_axis_variables_torque) {
        CncDTO.cnc_axis_variables_torque = cnc_axis_variables_torque;
    }

    public static List<String> getCnc_axis_paName() {
        return cnc_axis_paName;
    }

    public static void setCnc_axis_paName(List<String> cnc_axis_paName) {
        CncDTO.cnc_axis_paName = cnc_axis_paName;
    }

    public static List<String> getCnc_axis_spMode() {
        return cnc_axis_spMode;
    }

    public static void setCnc_axis_spMode(List<String> cnc_axis_spMode) {
        CncDTO.cnc_axis_spMode = cnc_axis_spMode;
    }

    public static String getMainAxisOver() {
        return mainAxisOver;
    }

    public static void setMainAxisOver(String mainAxisOver) {
        CncDTO.mainAxisOver = mainAxisOver;
    }

    public static String getMainAxisFeed() {
        return mainAxisFeed;
    }

    public static void setMainAxisFeed(String mainAxisFeed) {
        CncDTO.mainAxisFeed = mainAxisFeed;
    }

    public static String getMainAxisAct() {
        return mainAxisAct;
    }

    public static void setMainAxisAct(String mainAxisAct) {
        CncDTO.mainAxisAct = mainAxisAct;
    }

    public static String getMainAxisPosition() {
        return mainAxisPosition;
    }

    public static void setMainAxisPosition(String mainAxisPosition) {
        CncDTO.mainAxisPosition = mainAxisPosition;
    }

    public static List<String> getCnc_axis_name() {
        return cnc_axis_name;
    }

    public static void setCnc_axis_name(List<String> cnc_axis_name) {
        CncDTO.cnc_axis_name = cnc_axis_name;
    }

    public static List<String> getCnc_axis_main() {
        return cnc_axis_main;
    }

    public static void setCnc_axis_main(List<String> cnc_axis_main) {
        CncDTO.cnc_axis_main = cnc_axis_main;
    }

    public static List<String> getCnc_axis_logic() {
        return cnc_axis_logic;
    }

    public static void setCnc_axis_logic(List<String> cnc_axis_logic) {
        CncDTO.cnc_axis_logic = cnc_axis_logic;
    }

    public static String getTools() {
        return tools;
    }

    public static void setTools(String tools) {
        CncDTO.tools = tools;
    }

    public static String getMessage() {
        if (message == null) {
            return "[]";
        } else {
            return message;
        }

    }

    public static void setMessage(String message) {

        CncDTO.message = message;
    }




    public static String getCncNcFile() {
        return cncNcFile;
    }

    public static void setCncNcFile(String cncNcFile) {
        CncDTO.cncNcFile = cncNcFile;
    }


    public static Integer getCnc_axis_number() {
        return cnc_axis_number;
    }

    public static void setCnc_axis_number(Integer cnc_axis_number) {
        CncDTO.cnc_axis_number = cnc_axis_number;
    }

    public static String getCnc_state() {
        return cnc_state;
    }

    public static void setCnc_state(String cnc_state) {
        CncDTO.cnc_state = cnc_state;
    }

    public static String getCnc_ip() {
        return cnc_ip;
    }

    public static void setCnc_ip(String cnc_ip) {
        CncDTO.cnc_ip = cnc_ip;
    }

    public static String getCnc_port() {
        return cnc_port;
    }

    public static void setCnc_port(String cnc_port) {
        CncDTO.cnc_port = cnc_port;
    }



    public static String getCnc_trade_mark() {
        return cncBrand;
    }

    public static void setCnc_trade_mark(String cnc_trade_mark) {
        CncDTO.cncBrand = cnc_trade_mark;
    }

    /*CNC型号*/
    public static String getCncSeriesModel() {
        return cncSeriesModel;
    }

    public static void setCncSeriesModel(String cncSeriesModel) {
        CncDTO.cncSeriesModel = cncSeriesModel;
    }

    public static String getCnc_produceDate() {
        return cnc_produceDate;
    }

    public static void setCnc_produceDate(String cnc_produceDate) {
        CncDTO.cnc_produceDate = cnc_produceDate;
    }


    /*各种时间*/

    public static int getProctimestartNum() {
        return proctimestartNum;
    }

    public static void setProctimestartNum(int proctimestartNum) {
        CncDTO.proctimestartNum = proctimestartNum;
    }

    public static String getProctimestart() {
        return proctimestart;
    }

    public static void setProctimestart(String proctimestart) {
        CncDTO.proctimestart = proctimestart;
    }

    public static int getProctimeprocNum() {
        return proctimeprocNum;
    }

    public static void setProctimeprocNum(int proctimeprocNum) {
        CncDTO.proctimeprocNum = proctimeprocNum;
    }

    public static String getProctimeproc() {
        return proctimeproc;
    }

    public static void setProctimeproc(String proctimeproc) {
        CncDTO.proctimeproc = proctimeproc;
    }

    public static int getRemaindertimeNum() {
        return remaindertimeNum;
    }

    public static void setRemaindertimeNum(int remaindertimeNum) {
        CncDTO.remaindertimeNum = remaindertimeNum;
    }

    public static String getRemaindertime() {
        return remaindertime;
    }

    public static void setRemaindertime(String remaindertime) {
        CncDTO.remaindertime = remaindertime;
    }

    public static Map<String, String> getCncPlcMap() {
        return cncPlcMap;
    }

    public static void setCncPlcMap(Map<String, String> cncPlcMap) {
        CncDTO.cncPlcMap = cncPlcMap;
    }
}
